///@Description(描述)     xxxx
///@author(作者)          zhangyinhong
///@create(时间)          2025-08-05 17:58

import 'package:app_core/app_core.dart';
import 'package:flutter/material.dart';
import 'package:yh_core_flutter_project/project/config/app_config.dart';
import 'package:yh_core_flutter_project/entry/app_start_up.dart';

Future<void> startRunApp() async {
    try {
        /// 0. 初始化 Flutter 绑定（必须在最前面）
        WidgetsFlutterBinding.ensureInitialized();
        
        /// 1. 初始化应用
        await AppStartUp.initialize();

        /// 2. 启动应用
        await AppRunManager.prepareRunApp(
            CoreConfig(
                appConfig: MyAppConfig(),
                netWorkConfig: MyNetWorkConfig(),
                intlConfig: MyIntlConfig(),
                widgetConfig: MyWidgetConfig(),
                dialogConfig: MyDialogConfig(),
            ),
        );
    } catch (e, stackTrace) {
        YHLog.e('🚨 应用启动失败: $e,📚 错误堆栈: $stackTrace');
    }
}

